<script setup>
import {ref} from "vue";
import {browse} from "@/api/plane.js";

const arr=ref([])
const getBrowse=async ()=>{
  const res=await browse()
  arr.value=res.data.data
  console.log(arr.value)
}
getBrowse()
</script>

<template>
  <div>
    <div class="top">
      <h2>我的浏览</h2>
    </div>
    <ul class="list">
      <li>产品信息</li>
      <li>产品金额</li>
      <li>浏览日期</li>
      <li>操作</li>
    </ul>
    <div>
      <div  v-for="item in arr" :key="item.id">
        <div class="item" v-if="item.classification==1">
          <div class="item_div1"><img src="https://img1.40017.cn/cn/c/order/s/2015/orderlist/img_hotel.jpg" alt=""></div>
          <div class="item_div2">
            <div class="title">{{item.data.address}}</div>
          </div>
          <div class="item_div3">￥{{item.data.price}}<span style="color: #333">&nbsp;起</span></div>
          <div class="item_div4">{{item.time.substring(0,10)}}</div>
          <div class="item_div6">
            <el-button type="success">查看商品</el-button>
          </div>
        </div>
        <div class="item" v-if="item.classification==2">
          <div class="item_div1"><img src="https://img1.40017.cn/cn/c/order/s/2015/orderlist/img_jd.jpg" alt=""></div>
          <div class="item_div2">
            <div class="title">{{item.data.name}}</div>
          </div>
          <div class="item_div3">￥{{item.data.price}}<span style="color: #333">&nbsp;起</span></div>
          <div class="item_div4">{{item.time.substring(0,10)}}</div>
          <div class="item_div6">
            <el-button type="success">查看商品</el-button>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<style scoped>
.top{
  display: flex;
  border-bottom: 1px solid rgba(0,0,0,.1);
  padding-bottom: 12px;
  h2{
    font-size: 28px;
    font-weight: 400;
    line-height:28px;
    padding: 15px 10px 0 10px;
  }
  .selected{
    margin-left: 20px;
    padding-top: 12px;
  }
}
.list{
  display: flex;
  border-bottom: 1px solid rgba(0,0,0,.1);
  li{
    font-size: 14px;
    color: #999;
    line-height: 22px;
    padding: 8px 0;
    text-align: center;
  }
  li:nth-of-type(1){
    width: 325px;
  }
  li:nth-of-type(2){
    width: 180px;
    margin-left: 32px;
  }
  li:nth-of-type(3){
    width: 190px;
  }
  li:nth-of-type(4){
    margin-left: 10px;
    width: 102px;
  }
  li:nth-of-type(5){
    width: 120px;
  }
}
.item{
  margin-top: 15px;
  display: flex;
  text-align: center;
  .item_div1{
    width: 115px;
    height: 90px;
  }
  .item_div2{
    width: 215px;
    margin-left: 12px;
    line-height: 22px;
    text-align: left;
    .title{
      font-weight: 700;
      color: #333;
      font-size: 14px;
      margin-bottom: 3px;
      line-height: 22px;
    }
    .content{
      font-size: 12px;
      color: #666;
      line-height: 20px;
    }
  }
  .item_div3{
    font-weight: 700;
    width: 180px;
    margin-left: 14px;
    color:#ff6257;
  }
  .item_div4{
    width: 190px;
    color: #333;
    line-height: 22px;
  }
  .item_div5{
    line-height: 22px;
    width: 100px;
    margin-left: 13px;
  }
  .item_div6{
    margin-left: 22px;
  }

}
</style>